package controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/ServletLogin")
public class ServletLogin extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public ServletLogin() {
        super();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		PrintWriter pw = response.getWriter();
		String usuario = request.getParameter("usuario");
		String senha = request.getParameter("senha");
		if( !usuario.equalsIgnoreCase("") && !senha.equalsIgnoreCase("")){
			RequestDispatcher rd = request.getRequestDispatcher("lista_servlets/menu.html");
			rd.forward(request, response);
		}else{
			pw.print("Verifique preenchimento dos campos");
		}
		pw.close();
	}
}